package Thread.New.Semaphore;


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;

public class Main {
    public static void main(String[] args) {
        ExecutorService es = Executors.newFixedThreadPool(6);

        Semaphore semaphore = new Semaphore(4);
        es.submit(new RunnableImpl(semaphore,"A"));
        es.submit(new RunnableImpl(semaphore,"B"));
        es.submit(new RunnableImpl(semaphore,"C"));
        es.submit(new RunnableImpl(semaphore,"D"));
        es.submit(new RunnableImpl(semaphore,"E"));
        es.submit(new RunnableImpl(semaphore,"F"));
    }
}
